import { NotifyService } from '@abp/notify/notify.service';
import { Component, Injector, ViewChild, ViewEncapsulation } from '@angular/core';
import { Http } from '@angular/http';
import { appModuleAnimation } from '@shared/animations/routerTransition';
import { AppComponentBase } from '@shared/common/app-component-base';
import { FileDownloadService } from '@shared/utils/file-download.service';
import { LazyLoadEvent } from 'primeng/components/common/lazyloadevent';
import { Paginator } from 'primeng/components/paginator/paginator';
import { Table } from 'primeng/components/table/table';


@Component({
  templateUrl: './book-log.component.html',
  encapsulation: ViewEncapsulation.None,
  animations: [appModuleAnimation()]
})

export class MaterialBookLogComponent extends AppComponentBase {
  @ViewChild('dataTable') dataTable: Table;
  @ViewChild('paginator') paginator: Paginator;

  advancedFiltersAreShown = false;
  filterText = '';

  constructor(
    injector: Injector,
    // private _bookServiceProxy: BookMaterialServiceProxy,
  ) {
    super(injector);
  }

  getBookLogs(event?: LazyLoadEvent) {
    if (this.primengTableHelper.shouldResetPaging(event)) {
      this.paginator.changePage(0);
      return;
    }

    // this.primengTableHelper.showLoadingIndicator();

    // this._bookServiceProxy.getBookWarehouseLogs(
    //   this.filterText,
    //   this.primengTableHelper.getSorting(this.dataTable),
    //   this.primengTableHelper.getMaxResultCount(this.paginator, event),
    //   this.primengTableHelper.getSkipCount(this.paginator, event)
    // ).subscribe(result => {
    //   this.primengTableHelper.totalRecordsCount = result.totalCount;
    //   this.primengTableHelper.records = result.items;
    //   this.primengTableHelper.hideLoadingIndicator();
    // });
  }
}
